<template>
    <!-- <a-select show-search :filter-option="filterOption" placeholder="获奖类别" v-model:value="valueId" style="width: 200px"
        :options="dicts"></a-select> -->

    <a-cascader :filter="filterOption" v-model:value="valueId" :options="dicts" placeholder="请选择获奖" />
</template>
<script setup>
import { queryList } from '../../../../api/nepu_raward_dict';
const emit = defineEmits(['update:value']);
const props = defineProps({
    value: {
        type: Object
    }
})
const componentKey = ref(0);
const dicts = ref([])
const valueId = computed({
    get: () => props.value,
    set: (val) => {
        console.log('修改' + val)
        emit('update:value', val)
    }
});
const filterOption = (input, option) => {
    return option.label.indexOf(input.toLowerCase()) >= 0;
};
queryList({
    pageSize: 500,
    pageNum: 1
}).then(res => {
    console.log(res)
    let tarr = res.content
    tarr = tarr.map(ele => {
        ele.label = ele.awardName
        ele.value = ele.id
        return ele
    })
    dicts.value = tarr
})
//确定获奖
function confirmAward(e) {
    formData.value.awardDictId = e;
    const tarr = dict.value;

    tarr.forEach((item) => {
        if (item.id == e) {
            awardName.value = item.awardName;
        }
    });
}
// const typeOptions = computed(() => {
//     let arr = $.freeStore(jobStore.types);
//     arr.map(ele => {
//         ele.label = ele.jobTypeName,
//             ele.value = ele.id
//     })
//     return arr
// })
</script>